<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:78:"E:\phpStudy\PHPTutorial\WWW\yzf/application/admin\view\user\chongzhiindex.html";i:1556606573;s:71:"E:\phpStudy\PHPTutorial\WWW\yzf\application\admin\view\common\head.html";i:1556002984;}*/ ?>
<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>聚财国际</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/public/static/css/font.css"> 
	<link href="/favicon.ico" type="image/x-icon" rel="shortcut icon" /> 
    <link rel="stylesheet" href="/public/static/css/xadmin.css">
    <link href="/public/static/lib/layui/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="/public/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="/public/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/public/static/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/css">
      #fff{
        border: red solid 1px;
      }
    </script>
  </head>
  
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">演示</a>
        <a>
          <cite>充值管理</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="<?php echo url('admin/user/chongzhiindex'); ?>" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
            <div class="layui-input-inline">
                <select name="cateid">
                    <option value="">搜索关键词</option>
                    <option value="u_phone">账号</option>
                </select>
            </div>
            <input type="text" name="Key"  placeholder="请输入关键词" autocomplete="off" class="layui-input">
            <input type="submit" name="sub" class="layui-btn" value="开始搜索" lay-submit="" lay-filter="sreach">
        </form>
    </div>
    <table class="layui-table">
        <thead>
        <tr style="text-align: center">
            <th style="text-align: center">NO</th>
            <th style="text-align: center">订单号</th>
            <th style="text-align: center">账号</th>
            <th style="text-align: center">姓名</th>
            <th style="text-align: center">充值金额</th>
            <th style="text-align: center">充值方式</th>
            <th style="text-align: center">充值时间</th>
            <th style="text-align: center">状态</th>
            <th style="text-align: center">备注(前8字)</th>
            <?php if(\think\Session::get('admin_uid')==1): ?><th style="text-align: center">操作</th><?php else: endif; ?>
        </tr>
        </thead>
        <tbody>
        <?php if(is_array($rs) || $rs instanceof \think\Collection || $rs instanceof \think\Paginator): $i = 0; $__LIST__ = $rs;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?>
        <tr style="text-align: center">
            <td><?php echo $key+1; ?></td>
            <td><?php echo $rs['c_number']; ?></td>
            <td><?php echo $rs['u_phone']; ?></td>
            <td><?php echo $rs['u_name']; ?></td>     
            <td><?php echo $rs['c_money']; ?></td>
            <td><?php echo $rs['z_type']; ?></td>
            <td><?php echo $rs['c_createtime']; ?></td>
            <td class="td-status"><span><?php if($rs['c_state']==1): ?><span class="layui-btn layui-btn-sm layui-btn-danger">等待充值</span><?php elseif($rs['c_state']==3): ?><span class="layui-btn layui-btn-sm">充值完成</span><?php else: ?><span class="layui-btn layui-btn-sm layui-btn-normal">已退回</span><?php endif; ?></span></td>
            <td><?php echo mb_substr($rs['c_descs'],0,8,'utf-8'); ?></td>
            <?php if(\think\Session::get('admin_uid')==1): ?>
            <td class="td-manage">
                <span>
                <?php if($rs['c_state']==2): ?>
                <?php echo mb_substr($rs['c_reason'],0,8,'utf-8'); elseif($rs['c_state']==1): ?>
                <a onclick="member_stop(this,'<?php echo $rs['cid']; ?>')" href="javascript:;"  title="通过">
                    <span style="color: mediumblue">充值</span>
                </a> ||
                <a title="详情" href="javascript:;" attr_id='<?php echo $rs['cid']; ?>' onclick="banner_edit(this)">
                    <span style="color: mediumblue">拒绝</span>
                </a>
                <?php else: ?>
                <span class="layui-btn layui-btn-sm">充值完成</span>
                <?php endif; ?>
                </span>
            </td><?php else: endif; ?>
        </tr>
        <?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
    <div class="page">
        <div>
        <?php echo $page; ?>
        </div>
    </div>

</div>
<script>
    function banner_edit(obj){
        var mid=$(obj).attr('attr_id');
        //alert(mid);
        var url="<?php echo Url('admin/user/chongzhireason'); ?>?cid="+  mid;
        // alert(url);
        x_admin_show('详情',url);
    }
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
    });

    /*用户-停用*/
    function member_stop(obj,id){
        layer.confirm('确定充值信用额度到账吗？',function(index){
            $.ajax({
                url:'<?php echo URL("admin/user/chongzhi"); ?>',
                data:{'cid':id},
                type:'post',
                dataType:'json',
                success:function(msg){
                    if(msg==1){
                       //$(obj).parents("tr").find(".td-status").html('');
                       // $(obj).parents("tr").find(".td-manage").html('');
                        $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn layui-btn-sm').html('充值完成');
                        //alert(525);
                        $(obj).parents("tr").find(".td-manage").find('span').addClass('layui-btn layui-btn-sm').html('充值完成');
                        layer.msg('充值成功!',{icon: 1,time:1000});
                    }
                }
            });
            /*if($(obj).attr('title')=='启用'){

                //发异步把用户状态进行更改
                $(obj).attr('title','停用')
                $(obj).find('i').html('&#xe62f;');

                $(obj).parents("tr").find(".td-manage").find('span').addClass('layui-btn-disabled').html('已停用');
                layer.msg('操作成功!',{icon: 5,time:1000});

            }else{
                $(obj).attr('title','启用')
                $(obj).find('i').html('&#xe601;');

                $(obj).parents("tr").find(".td-manage").find('span').removeClass('layui-btn-disabled').html('已启用');
                layer.msg('操作成功!',{icon: 5,time:1000});
            }*/

        });
    }

    /*用户-删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }



    function delAll (argument) {

        var data = tableCheck.getData();

        layer.confirm('确认要删除吗？'+data,function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
    }
</script>

</body>

</html>